#include "form1_1.h"
#include "ui_form1_1.h"

Form1_1::Form1_1(FlightBookingSystem& system,string des,QWidget *parent)
    :bookingSystem(system),
    destination(des),
    QWidget(parent),
    ui(new Ui::Form1_1)
{
    ui->setupUi(this);
}

Form1_1::~Form1_1()
{
    delete ui;
}

void Form1_1::on_pushButton_clicked()
{
    emit this->back();
}

void Form1_1::showEvent(QShowEvent *event)
{
    bookingSystem.queryFlight(this->destination,ui->textBrowser);
}
